home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / OCEMessaging.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  31KB  |  1,096 lines

  1. /*
  2.      File:        OCEMessaging.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Messaging Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __OCEMESSAGING__
  19. #define __OCEMESSAGING__
  20.  
  21. #ifndef __FILES__
  22. #include <Files.h>
  23. #endif
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. #ifndef __DIGITALSIGNATURE__
  28. #include <DigitalSignature.h>
  29. #endif
  30. #ifndef __OCE__
  31. #include <OCE.h>
  32. #endif
  33. #ifndef __OCEAUTHDIR__
  34. #include <OCEAuthDir.h>
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_ALIGN_SUPPORTED
  46. #pragma options align=mac68k
  47. #endif
  48.  
  49. #if FOR_SYSTEM7_ONLY
  50. /******************************************************************************/
  51. /*
  52.  Definitions common to OCEMessaging and to OCEMail. These relate to addressing,
  53. message ids and priorities, etc. 
  54. */
  55. /* Values of IPMPriority */
  56.  
  57. enum {
  58.     kIPMAnyPriority                = 0,                            /* FOR FILTER ONLY */
  59.     kIPMNormalPriority            = 1,
  60.     kIPMLowPriority                = 2,
  61.     kIPMHighPriority            = 3
  62. };
  63.  
  64. typedef Byte IPMPriority;
  65. /* Values of IPMAccessMode */
  66.  
  67. enum {
  68.     kIPMAtMark                    = 0,
  69.     kIPMFromStart                = 1,
  70.     kIPMFromLEOM                = 2,
  71.     kIPMFromMark                = 3
  72. };
  73.  
  74. typedef unsigned short IPMAccessMode;
  75.  
  76. enum {
  77.     kIPMUpdateMsgBit            = 4,
  78.     kIPMNewMsgBit                = 5,
  79.     kIPMDeleteMsgBit            = 6
  80. };
  81.  
  82. /* Values of IPMNotificationType */
  83.  
  84. enum {
  85.     kIPMUpdateMsgMask            = 1 << kIPMUpdateMsgBit,
  86.     kIPMNewMsgMask                = 1 << kIPMNewMsgBit,
  87.     kIPMDeleteMsgMask            = 1 << kIPMDeleteMsgBit
  88. };
  89.  
  90. typedef Byte IPMNotificationType;
  91. /* Values of IPMSenderTag */
  92.  
  93. enum {
  94.     kIPMSenderRStringTag        = 0,
  95.     kIPMSenderRecordIDTag        = 1
  96. };
  97.  
  98. typedef unsigned short IPMSenderTag;
  99.  
  100. enum {
  101.     kIPMFromDistListBit            = 0,
  102.     kIPMDummyRecBit                = 1,
  103.     kIPMFeedbackRecBit            = 2,                            /* should be redirected to feedback queue */
  104.     kIPMReporterRecBit            = 3,                            /* should be redirected to reporter original queue */
  105.     kIPMBCCRecBit                = 4                                /* this recipient is blind to all recipients of message */
  106. };
  107.  
  108. /* Values of OCERecipientOffsetFlags */
  109.  
  110. enum {
  111.     kIPMFromDistListMask        = 1 << kIPMFromDistListBit,
  112.     kIPMDummyRecMask            = 1 << kIPMDummyRecBit,
  113.     kIPMFeedbackRecMask            = 1 << kIPMFeedbackRecBit,
  114.     kIPMReporterRecMask            = 1 << kIPMReporterRecBit,
  115.     kIPMBCCRecMask                = 1 << kIPMBCCRecBit
  116. };
  117.  
  118. typedef Byte OCERecipientOffsetFlags;
  119. struct OCECreatorType {
  120.     OSType                             msgCreator;
  121.     OSType                             msgType;
  122. };
  123. typedef struct OCECreatorType OCECreatorType;
  124.  
  125.  
  126. enum {
  127.     kIPMTypeWildCard            = 'ipmw',
  128.     kIPMFamilyUnspecified        = 0,
  129.     kIPMFamilyWildCard            = 0x3F3F3F3F,                    /* '????' * well known signature */
  130.     kIPMSignature                = 'ipms',                        /* base type * well known message types */
  131.     kIPMReportNotify            = 'rptn',                        /* routing feedback * well known message block types */
  132.     kIPMEnclosedMsgType            = 'emsg',                        /* enclosed (nested) message */
  133.     kIPMReportInfo                = 'rpti',                        /* recipient information */
  134.     kIPMDigitalSignature        = 'dsig'                        /* digital signature */
  135. };
  136.  
  137. /* Values of IPMMsgFormat */
  138.  
  139. enum {
  140.     kIPMOSFormatType            = 1,
  141.     kIPMStringFormatType        = 2
  142. };
  143.  
  144. typedef unsigned short IPMMsgFormat;
  145. typedef Str32 IPMStringMsgType;
  146. union TheType {
  147.     OCECreatorType                     msgOSType;
  148.     IPMStringMsgType                 msgStrType;
  149. };
  150. typedef union TheType TheType;
  151.  
  152. struct IPMMsgType {
  153.     IPMMsgFormat                     format;                        /* IPMMsgFormat*/
  154.     TheType                         theType;
  155. };
  156. typedef struct IPMMsgType IPMMsgType;
  157.  
  158. /*
  159. Following are the known extension values for IPM addresses handled by Apple.
  160. We define the definition of the entn extension below.
  161. */
  162.  
  163. enum {
  164.     kOCEalanXtn                    = 'alan',
  165.     kOCEentnXtn                    = 'entn',                        /* entn = entity name (aka DSSpec) */
  166.     kOCEaphnXtn                    = 'aphn'
  167. };
  168.  
  169. /*
  170. Following are the specific definitions for the extension for the standard
  171. OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in
  172. IPMEntityNameExtension.]
  173. */
  174. /* entn extension forms */
  175.  
  176. enum {
  177.     kOCEAddrXtn                    = 'addr',
  178.     kOCEQnamXtn                    = 'qnam',
  179.     kOCEAttrXtn                    = 'attr',                        /* an attribute specification */
  180.     kOCESpAtXtn                    = 'spat'                        /* specific attribute */
  181. };
  182.  
  183. /*
  184. Following are the specific definitions for standard
  185. OCEMail 'aphn' extension value.  
  186.  
  187. All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
  188. if length odd, then a pad byte (zero) should be introduced before the next field).
  189.  
  190. The extension value is in the packed form of the following structure:
  191.     RString        phoneNumber;
  192.     RString        modemType;
  193.     Str32        queueuName;
  194.  
  195. The body of phoneNumber compound RString is in the packed form of the following structure:
  196.     short         subType;
  197.     RString     countryCode;                // used when subType == kOCEUseHandyDial
  198.     RString        areaCode;                    // used when subType == kOCEUseHandyDial
  199.     RString        phone;                        // used when subType == kOCEUseHandyDial
  200.     RString        postFix;                    // used when subType == kOCEUseHandyDial
  201.     RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial
  202. */
  203. /* phoneNumber sub type constants */
  204.  
  205. enum {
  206.     kOCEUseHandyDial            = 1,
  207.     kOCEDontUseHandyDial        = 2
  208. };
  209.  
  210. /* FORMAT OF A PACKED FORM RECIPIENT */
  211. struct ProtoOCEPackedRecipient {
  212.     unsigned short                     dataLength;
  213. };
  214. typedef struct ProtoOCEPackedRecipient ProtoOCEPackedRecipient;
  215.  
  216.  
  217. enum {
  218.     kOCEPackedRecipientMaxBytes    = (4096 - sizeof(ProtoOCEPackedRecipient))
  219. };
  220.  
  221. struct OCEPackedRecipient {
  222.     unsigned short                     dataLength;
  223.     Byte                             data[4094];
  224. };
  225. typedef struct OCEPackedRecipient OCEPackedRecipient;
  226.  
  227. struct IPMEntnQueueExtension {
  228.     Str32                             queueName;
  229. };
  230. typedef struct IPMEntnQueueExtension IPMEntnQueueExtension;
  231.  
  232. /* kOCEAttrXtn */
  233. struct IPMEntnAttributeExtension {
  234.     AttributeType                     attributeName;
  235. };
  236. typedef struct IPMEntnAttributeExtension IPMEntnAttributeExtension;
  237.  
  238. /* kOCESpAtXtn */
  239. struct IPMEntnSpecificAttributeExtension {
  240.     AttributeCreationID             attributeCreationID;
  241.     AttributeType                     attributeName;
  242. };
  243. typedef struct IPMEntnSpecificAttributeExtension IPMEntnSpecificAttributeExtension;
  244.  
  245. /* All IPM entn extensions fit within the following */
  246. struct IPMEntityNameExtension {
  247.     OSType                             subExtensionType;
  248.     union {
  249.         IPMEntnSpecificAttributeExtension  specificAttribute;
  250.         IPMEntnAttributeExtension         attribute;
  251.         IPMEntnQueueExtension             queue;
  252.     }                                 u;
  253. };
  254. typedef struct IPMEntityNameExtension IPMEntityNameExtension;
  255.  
  256. /* addresses with kIPMNBPXtn should specify this nbp type */
  257. #define kIPMWSReceiverNBPType "\pMsgReceiver" 
  258. struct IPMMsgID {
  259.     unsigned long                     id[4];
  260. };
  261. typedef struct IPMMsgID IPMMsgID;
  262.  
  263. /* Values of IPMHeaderSelector */
  264.  
  265. enum {
  266.     kIPMTOC                        = 0,
  267.     kIPMSender                    = 1,
  268.     kIPMProcessHint                = 2,
  269.     kIPMMessageTitle            = 3,
  270.     kIPMMessageType                = 4,
  271.     kIPMFixedInfo                = 7
  272. };
  273.  
  274. typedef Byte IPMHeaderSelector;
  275. union TheSender {
  276.     RString                         rString;
  277.     PackedRecordID                     rid;
  278. };
  279. typedef union TheSender TheSender;
  280.  
  281. struct IPMSender {
  282.     IPMSenderTag                     sendTag;
  283.     TheSender                         theSender;
  284. };
  285. typedef struct IPMSender IPMSender;
  286.  
  287. /******************************************************************************/
  288. /* Definitions specific to OCEMessaging */
  289. typedef unsigned long IPMContextRef;
  290. typedef unsigned long IPMQueueRef;
  291. typedef unsigned long IPMMsgRef;
  292. typedef unsigned long IPMSeqNum;
  293. typedef Str32 IPMProcHint;
  294. typedef Str32 IPMQueueName;
  295. typedef pascal void (*IPMNoteProcPtr)(IPMQueueRef queue, IPMSeqNum seqNum, IPMNotificationType notificationType, unsigned long userData);
  296.  
  297. #if GENERATINGCFM
  298. typedef UniversalProcPtr IPMNoteUPP;
  299. #else
  300. typedef IPMNoteProcPtr IPMNoteUPP;
  301. #endif
  302.  
  303. enum {
  304.     uppIPMNoteProcInfo = kPascalStackBased
  305.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(IPMQueueRef)))
  306.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(IPMSeqNum)))
  307.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(IPMNotificationType)))
  308.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(unsigned long)))
  309. };
  310.  
  311. #if GENERATINGCFM
  312. #define NewIPMNoteProc(userRoutine)        \
  313.         (IPMNoteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIPMNoteProcInfo, GetCurrentArchitecture())
  314. #else
  315. #define NewIPMNoteProc(userRoutine)        \
  316.         ((IPMNoteUPP) (userRoutine))
  317. #endif
  318.  
  319. #if GENERATINGCFM
  320. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  321.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMNoteProcInfo, (queue), (seqNum), (notificationType), (userData))
  322. #else
  323. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  324.         (*(userRoutine))((queue), (seqNum), (notificationType), (userData))
  325. #endif
  326. struct IPMFixedHdrInfo {
  327.     unsigned short                     version;
  328.     Boolean                         authenticated;
  329.     Boolean                         signatureEnclosed;            /*  digital signature enclosed */
  330.     unsigned long                     msgSize;
  331.     IPMNotificationType             notification;
  332.     IPMPriority                     priority;
  333.     unsigned short                     blockCount;
  334.     unsigned short                     originalRcptCount;            /*        original number of recipients */
  335.     unsigned long                     refCon;                        /*        Client defined data */
  336.     unsigned short                     reserved;
  337.     UTCTime                         creationTime;                /*        Time when it was created */
  338.     IPMMsgID                         msgID;
  339.     OSType                             family;                        /* family this msg belongs (e.g. mail) */
  340. };
  341. typedef struct IPMFixedHdrInfo IPMFixedHdrInfo;
  342.  
  343.  
  344. enum {
  345.     kIPMDeliveryNotificationBit    = 0,
  346.     kIPMNonDeliveryNotificationBit = 1,
  347.     kIPMEncloseOriginalBit        = 2,
  348.     kIPMSummaryReportBit        = 3,                            /* modify enclose original to only on error */
  349.     kIPMOriginalOnlyOnErrorBit    = 4
  350. };
  351.  
  352.  
  353. enum {
  354.     kIPMNoNotificationMask        = 0x00,
  355.     kIPMDeliveryNotificationMask = 1 << kIPMDeliveryNotificationBit,
  356.     kIPMNonDeliveryNotificationMask = 1 << kIPMNonDeliveryNotificationBit,
  357.     kIPMDontEncloseOriginalMask    = 0x00,
  358.     kIPMEncloseOriginalMask        = 1 << kIPMEncloseOriginalBit,
  359.     kIPMImmediateReportMask        = 0x00,
  360.     kIPMSummaryReportMask        = 1 << kIPMSummaryReportBit,
  361.     kIPMOriginalOnlyOnErrorMask    = 1 << kIPMOriginalOnlyOnErrorBit,
  362.     kIPMEncloseOriginalOnErrorMask = (kIPMOriginalOnlyOnErrorMask | kIPMEncloseOriginalMask)
  363. };
  364.  
  365. /* standard Non delivery codes */
  366.  
  367. enum {
  368.     kIPMNoSuchRecipient            = 0x0001,
  369.     kIPMRecipientMalformed        = 0x0002,
  370.     kIPMRecipientAmbiguous        = 0x0003,
  371.     kIPMRecipientAccessDenied    = 0x0004,
  372.     kIPMGroupExpansionProblem    = 0x0005,
  373.     kIPMMsgUnreadable            = 0x0006,
  374.     kIPMMsgExpired                = 0x0007,
  375.     kIPMMsgNoTranslatableContent = 0x0008,
  376.     kIPMRecipientReqStdCont        = 0x0009,
  377.     kIPMRecipientReqSnapShot    = 0x000A,
  378.     kIPMNoTransferDiskFull        = 0x000B,
  379.     kIPMNoTransferMsgRejectedbyDest = 0x000C,
  380.     kIPMNoTransferMsgTooLarge    = 0x000D
  381. };
  382.  
  383. /*************************************************************************/
  384. /*
  385. This is the structure that will be returned by enumerate and getmsginfo
  386. This definition is just to give you a template, the position of msgType
  387. is variable since this is a packed structure.  procHint and msgType are
  388. packed and even length padded.
  389.  
  390. * master message info 
  391. */
  392. struct IPMMsgInfo {
  393.     IPMSeqNum                         sequenceNum;
  394.     unsigned long                     userData;
  395.     unsigned short                     respIndex;
  396.     SInt8                             padByte;
  397.     IPMPriority                     priority;
  398.     unsigned long                     msgSize;
  399.     unsigned short                     originalRcptCount;
  400.     unsigned short                     reserved;
  401.     UTCTime                         creationTime;
  402.     IPMMsgID                         msgID;
  403.     OSType                             family;                        /* family this msg belongs (e.g. mail) */
  404.     IPMProcHint                     procHint;
  405.     SInt8                             filler2;
  406.     IPMMsgType                         msgType;
  407. };
  408. typedef struct IPMMsgInfo IPMMsgInfo;
  409.  
  410. typedef OCECreatorType IPMBlockType;
  411. struct IPMTOC {
  412.     IPMBlockType                     blockType;
  413.     long                             blockOffset;
  414.     unsigned long                     blockSize;
  415.     unsigned long                     blockRefCon;
  416. };
  417. typedef struct IPMTOC IPMTOC;
  418.  
  419. /*
  420. The following structure is just to describe the layout of the SingleFilter.
  421. Each field should be packed and word aligned when passed to the IPM ToolBox.
  422. */
  423. struct IPMSingleFilter {
  424.     IPMPriority                     priority;
  425.     SInt8                             padByte;
  426.     OSType                             family;                        /* family this msg belongs (e.g. mail), '????' for all */
  427.     ScriptCode                         script;                        /* Language Identifier */
  428.     IPMProcHint                     hint;
  429.     SInt8                             filler2;
  430.     IPMMsgType                         msgType;
  431. };
  432. typedef struct IPMSingleFilter IPMSingleFilter;
  433.  
  434. struct IPMFilter {
  435.     unsigned short                     count;
  436.     IPMSingleFilter                 sFilters[1];
  437. };
  438. typedef struct IPMFilter IPMFilter;
  439.  
  440. /*
  441. ************************************************************************
  442. Following structures define the ``start'' of a recipient report block and the
  443. elements of the array respectively.
  444. */
  445. struct IPMReportBlockHeader {
  446.     IPMMsgID                         msgID;                        /* message id of the original */
  447.     UTCTime                         creationTime;                /* creation time of the report */
  448. };
  449. typedef struct IPMReportBlockHeader IPMReportBlockHeader;
  450.  
  451. struct OCERecipientReport {
  452.     unsigned short                     rcptIndex;                    /* index of recipient in original message */
  453.     OSErr                             result;                        /* result of sending letter to this recipient*/
  454. };
  455. typedef struct OCERecipientReport OCERecipientReport;
  456.  
  457. /*************************************************************************/
  458. typedef union IPMParamBlock IPMParamBlock;
  459. typedef IPMParamBlock *IPMParamBlockPtr;
  460. /*
  461.         This ProcPtr uses register based parameters on the 68k and cannot
  462.         be written in or called from a high-level language without the help of
  463.         mixed mode or assembly glue.
  464.  
  465.             typedef pascal void (*IPMIOCompletionProcPtr)(IPMParamBlockPtr paramBlock);
  466.  
  467. */
  468.  
  469. #if GENERATINGCFM
  470. typedef UniversalProcPtr IPMIOCompletionUPP;
  471. #else
  472. typedef Register68kProcPtr IPMIOCompletionUPP;
  473. #endif
  474. struct IPMOpenContextPB {
  475.     void *                            qLink;
  476.     long                             reservedH1;
  477.     long                             reservedH2;
  478.     IPMIOCompletionUPP                 ioCompletion;
  479.     OSErr                             ioResult;
  480.     long                             saveA5;
  481.     short                             reqCode;
  482.     IPMContextRef                     contextRef;                    /* <--  Context reference to be used in further calls*/
  483. };
  484. typedef struct IPMOpenContextPB IPMOpenContextPB;
  485.  
  486. typedef IPMOpenContextPB IPMCloseContextPB;
  487. struct IPMCreateQueuePB {
  488.     void *                            qLink;
  489.     long                             reservedH1;
  490.     long                             reservedH2;
  491.     IPMIOCompletionUPP                 ioCompletion;
  492.     OSErr                             ioResult;
  493.     long                             saveA5;
  494.     short                             reqCode;
  495.     long                             filler1;
  496.     OCERecipient *                    queue;
  497.     AuthIdentity                     identity;                    /* used only if queue is remote */
  498.     PackedRecordID *                owner;                        /* used only if queue is remote */
  499. };
  500. typedef struct IPMCreateQueuePB IPMCreateQueuePB;
  501.  
  502. /* For createqueue and deletequeue only queue and identity are used */
  503. typedef IPMCreateQueuePB IPMDeleteQueuePB;
  504. struct IPMOpenQueuePB {
  505.     void *                            qLink;
  506.     long                             reservedH1;
  507.     long                             reservedH2;
  508.     IPMIOCompletionUPP                 ioCompletion;
  509.     OSErr                             ioResult;
  510.     long                             saveA5;
  511.     short                             reqCode;
  512.     IPMContextRef                     contextRef;
  513.     OCERecipient *                    queue;
  514.     AuthIdentity                     identity;
  515.     IPMFilter *                        filter;
  516.     IPMQueueRef                     newQueueRef;
  517.     IPMNoteUPP                         notificationProc;
  518.     unsigned long                     userData;
  519.     IPMNotificationType             noteType;
  520.     Byte                             padByte;
  521.     long                             reserved;
  522.     long                             reserved2;
  523. };
  524. typedef struct IPMOpenQueuePB IPMOpenQueuePB;
  525.  
  526. struct IPMCloseQueuePB {
  527.     void *                            qLink;
  528.     long                             reservedH1;
  529.     long                             reservedH2;
  530.     IPMIOCompletionUPP                 ioCompletion;
  531.     OSErr                             ioResult;
  532.     long                             saveA5;
  533.     short                             reqCode;
  534.     IPMQueueRef                     queueRef;
  535. };
  536. typedef struct IPMCloseQueuePB IPMCloseQueuePB;
  537.  
  538. struct IPMEnumerateQueuePB {
  539.     void *                            qLink;
  540.     long                             reservedH1;
  541.     long                             reservedH2;
  542.     IPMIOCompletionUPP                 ioCompletion;
  543.     OSErr                             ioResult;
  544.     long                             saveA5;
  545.     short                             reqCode;
  546.     IPMQueueRef                     queueRef;
  547.     IPMSeqNum                         startSeqNum;
  548.     Boolean                         getProcHint;
  549.     Boolean                         getMsgType;
  550.     short                             filler;
  551.     IPMFilter *                        filter;
  552.     unsigned short                     numToGet;
  553.     unsigned short                     numGotten;
  554.     unsigned long                     enumCount;
  555.     void *                            enumBuffer;                    /* will be packed array of IPMMsgInfo */
  556.     unsigned long                     actEnumCount;
  557. };
  558. typedef struct IPMEnumerateQueuePB IPMEnumerateQueuePB;
  559.  
  560. typedef IPMEnumerateQueuePB IPMChangeQueueFilterPB;
  561. struct IPMDeleteMsgRangePB {
  562.     void *                            qLink;
  563.     long                             reservedH1;
  564.     long                             reservedH2;
  565.     IPMIOCompletionUPP                 ioCompletion;
  566.     OSErr                             ioResult;
  567.     long                             saveA5;
  568.     short                             reqCode;
  569.     IPMQueueRef                     queueRef;
  570.     IPMSeqNum                         startSeqNum;
  571.     IPMSeqNum                         endSeqNum;
  572.     IPMSeqNum                         lastSeqNum;
  573. };
  574. typedef struct IPMDeleteMsgRangePB IPMDeleteMsgRangePB;
  575.  
  576. struct IPMOpenMsgPB {
  577.     void *                            qLink;
  578.     long                             reservedH1;
  579.     long                             reservedH2;
  580.     IPMIOCompletionUPP                 ioCompletion;
  581.     OSErr                             ioResult;
  582.     long                             saveA5;
  583.     short                             reqCode;
  584.     IPMQueueRef                     queueRef;
  585.     IPMSeqNum                         sequenceNum;
  586.     IPMMsgRef                         newMsgRef;
  587.     IPMSeqNum                         actualSeqNum;
  588.     Boolean                         exactMatch;
  589.     Byte                             padByte;
  590.     long                             reserved;
  591. };
  592. typedef struct IPMOpenMsgPB IPMOpenMsgPB;
  593.  
  594. struct IPMOpenHFSMsgPB {
  595.     void *                            qLink;
  596.     long                             reservedH1;
  597.     long                             reservedH2;
  598.     IPMIOCompletionUPP                 ioCompletion;
  599.     OSErr                             ioResult;
  600.     long                             saveA5;
  601.     short                             reqCode;
  602.     FSSpec *                        hfsPath;
  603.     long                             filler;
  604.     IPMMsgRef                         newMsgRef;
  605.     long                             filler2;
  606.     Byte                             filler3;
  607.     Boolean                         filler4;
  608.     long                             reserved;
  609. };
  610. typedef struct IPMOpenHFSMsgPB IPMOpenHFSMsgPB;
  611.  
  612. struct IPMOpenBlockAsMsgPB {
  613.     void *                            qLink;
  614.     long                             reservedH1;
  615.     long                             reservedH2;
  616.     IPMIOCompletionUPP                 ioCompletion;
  617.     OSErr                             ioResult;
  618.     long                             saveA5;
  619.     short                             reqCode;
  620.     IPMMsgRef                         msgRef;
  621.     unsigned long                     filler;
  622.     IPMMsgRef                         newMsgRef;
  623.     unsigned short                     filler2[7];
  624.     unsigned short                     blockIndex;
  625. };
  626. typedef struct IPMOpenBlockAsMsgPB IPMOpenBlockAsMsgPB;
  627.  
  628. struct IPMCloseMsgPB {
  629.     void *                            qLink;
  630.     long                             reservedH1;
  631.     long                             reservedH2;
  632.     IPMIOCompletionUPP                 ioCompletion;
  633.     OSErr                             ioResult;
  634.     long                             saveA5;
  635.     short                             reqCode;
  636.     IPMMsgRef                         msgRef;
  637.     Boolean                         deleteMsg;
  638.     Boolean                         filler1;
  639. };
  640. typedef struct IPMCloseMsgPB IPMCloseMsgPB;
  641.  
  642. struct IPMGetMsgInfoPB {
  643.     void *                            qLink;
  644.     long                             reservedH1;
  645.     long                             reservedH2;
  646.     IPMIOCompletionUPP                 ioCompletion;
  647.     OSErr                             ioResult;
  648.     long                             saveA5;
  649.     short                             reqCode;
  650.     IPMMsgRef                         msgRef;
  651.     IPMMsgInfo *                    info;
  652. };
  653. typedef struct IPMGetMsgInfoPB IPMGetMsgInfoPB;
  654.  
  655. struct IPMReadHeaderPB {
  656.     void *                            qLink;
  657.     long                             reservedH1;
  658.     long                             reservedH2;
  659.     IPMIOCompletionUPP                 ioCompletion;
  660.     OSErr                             ioResult;
  661.     long                             saveA5;
  662.     short                             reqCode;
  663.     IPMMsgRef                         msgRef;
  664.     unsigned short                     fieldSelector;
  665.     long                             offset;
  666.     unsigned long                     count;
  667.     void *                            buffer;
  668.     unsigned long                     actualCount;
  669.     unsigned short                     filler;
  670.     unsigned long                     remaining;
  671. };
  672. typedef struct IPMReadHeaderPB IPMReadHeaderPB;
  673.  
  674. struct IPMReadRecipientPB {
  675.     void *                            qLink;
  676.     long                             reservedH1;
  677.     long                             reservedH2;
  678.     IPMIOCompletionUPP                 ioCompletion;
  679.     OSErr                             ioResult;
  680.     long                             saveA5;
  681.     short                             reqCode;
  682.     IPMMsgRef                         msgRef;
  683.     unsigned short                     rcptIndex;
  684.     long                             offset;
  685.     unsigned long                     count;
  686.     void *                            buffer;
  687.     unsigned long                     actualCount;
  688.     short                             reserved;                    /* must be zero */
  689.     unsigned long                     remaining;
  690.     unsigned short                     originalIndex;
  691.     OCERecipientOffsetFlags         recipientOffsetFlags;
  692.     Boolean                         filler1;
  693. };
  694. typedef struct IPMReadRecipientPB IPMReadRecipientPB;
  695.  
  696. /*
  697. replyQueue works like recipient. [can no longer read it via ReadHeader]
  698. OriginalIndex is meaningless, rcptFlags are used seperately and there are
  699. currently none defined.
  700. */
  701. typedef IPMReadRecipientPB IPMReadReplyQueuePB;
  702. struct IPMGetBlkIndexPB {
  703.     void *                            qLink;
  704.     long                             reservedH1;
  705.     long                             reservedH2;
  706.     IPMIOCompletionUPP                 ioCompletion;
  707.     OSErr                             ioResult;
  708.     long                             saveA5;
  709.     short                             reqCode;
  710.     IPMMsgRef                         msgRef;
  711.     IPMBlockType                     blockType;
  712.     unsigned short                     index;
  713.     unsigned short                     startingFrom;
  714.     IPMBlockType                     actualBlockType;
  715.     unsigned short                     actualBlockIndex;
  716. };
  717. typedef struct IPMGetBlkIndexPB IPMGetBlkIndexPB;
  718.  
  719. struct IPMReadMsgPB {
  720.     void *                            qLink;
  721.     long                             reservedH1;
  722.     long                             reservedH2;
  723.     IPMIOCompletionUPP                 ioCompletion;
  724.     OSErr                             ioResult;
  725.     long                             saveA5;
  726.     short                             reqCode;
  727.     IPMMsgRef                         msgRef;
  728.     IPMAccessMode                     mode;
  729.     long                             offset;
  730.     unsigned long                     count;
  731.     void *                            buffer;
  732.     unsigned long                     actualCount;
  733.     unsigned short                     blockIndex;
  734.     unsigned long                     remaining;
  735. };
  736. typedef struct IPMReadMsgPB IPMReadMsgPB;
  737.  
  738. struct IPMVerifySignaturePB {
  739.     void *                            qLink;
  740.     long                             reservedH1;
  741.     long                             reservedH2;
  742.     IPMIOCompletionUPP                 ioCompletion;
  743.     OSErr                             ioResult;
  744.     long                             saveA5;
  745.     short                             reqCode;
  746.     IPMMsgRef                         msgRef;
  747.     SIGContextPtr                     signatureContext;
  748. };
  749. typedef struct IPMVerifySignaturePB IPMVerifySignaturePB;
  750.  
  751. struct IPMNewMsgPB {
  752.     void *                            qLink;
  753.     long                             reservedH1;
  754.     long                             reservedH2;
  755.     IPMIOCompletionUPP                 ioCompletion;
  756.     OSErr                             ioResult;
  757.     long                             saveA5;
  758.     short                             reqCode;
  759.     unsigned long                     filler;
  760.     OCERecipient *                    recipient;
  761.     OCERecipient *                    replyQueue;
  762.     StringPtr                         procHint;
  763.     unsigned short                     filler2;
  764.     IPMMsgType *                    msgType;
  765.     unsigned long                     refCon;
  766.     IPMMsgRef                         newMsgRef;
  767.     unsigned short                     filler3;
  768.     long                             filler4;
  769.     AuthIdentity                     identity;
  770.     IPMSender *                        sender;
  771.     unsigned long                     internalUse;
  772.     unsigned long                     internalUse2;
  773. };
  774. typedef struct IPMNewMsgPB IPMNewMsgPB;
  775.  
  776. struct IPMNewHFSMsgPB {
  777.     void *                            qLink;
  778.     long                             reservedH1;
  779.     long                             reservedH2;
  780.     IPMIOCompletionUPP                 ioCompletion;
  781.     OSErr                             ioResult;
  782.     long                             saveA5;
  783.     short                             reqCode;
  784.     FSSpec *                        hfsPath;
  785.     OCERecipient *                    recipient;
  786.     OCERecipient *                    replyQueue;
  787.     StringPtr                         procHint;
  788.     unsigned short                     filler2;
  789.     IPMMsgType *                    msgType;
  790.     unsigned long                     refCon;
  791.     IPMMsgRef                         newMsgRef;
  792.     unsigned short                     filler3;
  793.     long                             filler4;
  794.     AuthIdentity                     identity;
  795.     IPMSender *                        sender;
  796.     unsigned long                     internalUse;
  797.     unsigned long                     internalUse2;
  798. };
  799. typedef struct IPMNewHFSMsgPB IPMNewHFSMsgPB;
  800.  
  801. struct IPMNestMsgPB {
  802.     void *                            qLink;
  803.     long                             reservedH1;
  804.     long                             reservedH2;
  805.     IPMIOCompletionUPP                 ioCompletion;
  806.     OSErr                             ioResult;
  807.     long                             saveA5;
  808.     short                             reqCode;
  809.     IPMMsgRef                         msgRef;
  810.     unsigned short                     filler[9];
  811.     unsigned long                     refCon;
  812.     IPMMsgRef                         msgToNest;
  813.     unsigned short                     filler2;
  814.     long                             startingOffset;
  815. };
  816. typedef struct IPMNestMsgPB IPMNestMsgPB;
  817.  
  818. struct IPMNewNestedMsgBlockPB {
  819.     void *                            qLink;
  820.     long                             reservedH1;
  821.     long                             reservedH2;
  822.     IPMIOCompletionUPP                 ioCompletion;
  823.     OSErr                             ioResult;
  824.     long                             saveA5;
  825.     short                             reqCode;
  826.     IPMMsgRef                         msgRef;
  827.     OCERecipient *                    recipient;
  828.     OCERecipient *                    replyQueue;
  829.     StringPtr                         procHint;
  830.     unsigned short                     filler1;
  831.     IPMMsgType *                    msgType;
  832.     unsigned long                     refCon;
  833.     IPMMsgRef                         newMsgRef;
  834.     unsigned short                     filler2;
  835.     long                             startingOffset;
  836.     AuthIdentity                     identity;
  837.     IPMSender *                        sender;
  838.     unsigned long                     internalUse;
  839.     unsigned long                     internalUse2;
  840. };
  841. typedef struct IPMNewNestedMsgBlockPB IPMNewNestedMsgBlockPB;
  842.  
  843. struct IPMEndMsgPB {
  844.     void *                            qLink;
  845.     long                             reservedH1;
  846.     long                             reservedH2;
  847.     IPMIOCompletionUPP                 ioCompletion;
  848.     OSErr                             ioResult;
  849.     long                             saveA5;
  850.     short                             reqCode;
  851.     IPMMsgRef                         msgRef;
  852.     IPMMsgID                         msgID;
  853.     RString *                        msgTitle;
  854.     IPMNotificationType             deliveryNotification;
  855.     IPMPriority                     priority;
  856.     Boolean                         cancel;
  857.     Byte                             padByte;
  858.     long                             reserved;
  859.     SIGSignaturePtr                 signature;
  860.     Size                             signatureSize;
  861.     SIGContextPtr                     signatureContext;
  862.                                                                 /* family this msg belongs (e.g. mail) use kIPMFamilyUnspecified by default */
  863.     OSType                             family;
  864. };
  865. typedef struct IPMEndMsgPB IPMEndMsgPB;
  866.  
  867. struct IPMAddRecipientPB {
  868.     void *                            qLink;
  869.     long                             reservedH1;
  870.     long                             reservedH2;
  871.     IPMIOCompletionUPP                 ioCompletion;
  872.     OSErr                             ioResult;
  873.     long                             saveA5;
  874.     short                             reqCode;
  875.     IPMMsgRef                         msgRef;
  876.     OCERecipient *                    recipient;
  877.     long                             reserved;
  878. };
  879. typedef struct IPMAddRecipientPB IPMAddRecipientPB;
  880.  
  881. struct IPMAddReplyQueuePB {
  882.     void *                            qLink;
  883.     long                             reservedH1;
  884.     long                             reservedH2;
  885.     IPMIOCompletionUPP                 ioCompletion;
  886.     OSErr                             ioResult;
  887.     long                             saveA5;
  888.     short                             reqCode;
  889.     IPMMsgRef                         msgRef;
  890.     long                             filler;
  891.     OCERecipient *                    replyQueue;
  892. };
  893. typedef struct IPMAddReplyQueuePB IPMAddReplyQueuePB;
  894.  
  895. struct IPMNewBlockPB {
  896.     void *                            qLink;
  897.     long                             reservedH1;
  898.     long                             reservedH2;
  899.     IPMIOCompletionUPP                 ioCompletion;
  900.     OSErr                             ioResult;
  901.     long                             saveA5;
  902.     short                             reqCode;
  903.     IPMMsgRef                         msgRef;
  904.     IPMBlockType                     blockType;
  905.     unsigned short                     filler[5];
  906.     unsigned long                     refCon;
  907.     unsigned short                     filler2[3];
  908.     long                             startingOffset;
  909. };
  910. typedef struct IPMNewBlockPB IPMNewBlockPB;
  911.  
  912. struct IPMWriteMsgPB {
  913.     void *                            qLink;
  914.     long                             reservedH1;
  915.     long                             reservedH2;
  916.     IPMIOCompletionUPP                 ioCompletion;
  917.     OSErr                             ioResult;
  918.     long                             saveA5;
  919.     short                             reqCode;
  920.     IPMMsgRef                         msgRef;
  921.     IPMAccessMode                     mode;
  922.     long                             offset;
  923.     unsigned long                     count;
  924.     void *                            buffer;
  925.     unsigned long                     actualCount;
  926.     Boolean                         currentBlock;
  927.     Boolean                         filler1;
  928. };
  929. typedef struct IPMWriteMsgPB IPMWriteMsgPB;
  930.  
  931. union IPMParamBlock {
  932.     struct {
  933.         void *                            qLink;
  934.         long                             reservedH1;
  935.         long                             reservedH2;
  936.         IPMIOCompletionUPP                 ioCompletion;
  937.         OSErr                             ioResult;
  938.         long                             saveA5;
  939.         short                             reqCode;
  940.     }                                 header;
  941.     IPMOpenContextPB                 openContextPB;
  942.     IPMCloseContextPB                 closeContextPB;
  943.     IPMCreateQueuePB                 createQueuePB;
  944.     IPMDeleteQueuePB                 deleteQueuePB;
  945.     IPMOpenQueuePB                     openQueuePB;
  946.     IPMCloseQueuePB                 closeQueuePB;
  947.     IPMEnumerateQueuePB             enumerateQueuePB;
  948.     IPMChangeQueueFilterPB             changeQueueFilterPB;
  949.     IPMDeleteMsgRangePB             deleteMsgRangePB;
  950.     IPMOpenMsgPB                     openMsgPB;
  951.     IPMOpenHFSMsgPB                 openHFSMsgPB;
  952.     IPMOpenBlockAsMsgPB             openBlockAsMsgPB;
  953.     IPMCloseMsgPB                     closeMsgPB;
  954.     IPMGetMsgInfoPB                 getMsgInfoPB;
  955.     IPMReadHeaderPB                 readHeaderPB;
  956.     IPMReadRecipientPB                 readRecipientPB;
  957.     IPMReadReplyQueuePB             readReplyQueuePB;
  958.     IPMGetBlkIndexPB                 getBlkIndexPB;
  959.     IPMReadMsgPB                     readMsgPB;
  960.     IPMVerifySignaturePB             verifySignaturePB;
  961.     IPMNewMsgPB                     newMsgPB;
  962.     IPMNewHFSMsgPB                     newHFSMsgPB;
  963.     IPMNestMsgPB                     nestMsgPB;
  964.     IPMNewNestedMsgBlockPB             newNestedMsgBlockPB;
  965.     IPMEndMsgPB                     endMsgPB;
  966.     IPMAddRecipientPB                 addRecipientPB;
  967.     IPMAddReplyQueuePB                 addReplyQueuePB;
  968.     IPMNewBlockPB                     newBlockPB;
  969.     IPMWriteMsgPB                     writeMsgPB;
  970. };
  971.  
  972.  
  973. enum {
  974.     uppIPMIOCompletionProcInfo = kRegisterBased
  975.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(IPMParamBlockPtr)))
  976. };
  977.  
  978. #if GENERATINGCFM
  979. #define CallIPMIOCompletionProc(userRoutine, paramBlock)        \
  980.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMIOCompletionProcInfo, (paramBlock))
  981. #else
  982. /* (*IPMIOCompletionUPP) cannot be called from a high-level language without the Mixed Mode Manager */
  983. #endif
  984.  
  985. #if GENERATINGCFM
  986. #define NewIPMIOCompletionProc(userRoutine)        \
  987.         (IPMIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIPMIOCompletionProcInfo, GetCurrentArchitecture())
  988. #else
  989. #define NewIPMIOCompletionProc(userRoutine)        \
  990.         ((IPMIOCompletionUPP) (userRoutine))
  991. #endif
  992. extern pascal OSErr IPMOpenContext(IPMParamBlockPtr paramBlock, Boolean async)
  993.  THREEWORDINLINE(0x3F3C, 0x0400, 0xAA5E);
  994.  
  995. extern pascal OSErr IPMCloseContext(IPMParamBlockPtr paramBlock, Boolean async)
  996.  THREEWORDINLINE(0x3F3C, 0x0401, 0xAA5E);
  997.  
  998. extern pascal OSErr IPMNewMsg(IPMParamBlockPtr paramBlock, Boolean async)
  999.  THREEWORDINLINE(0x3F3C, 0x0402, 0xAA5E);
  1000.  
  1001. extern pascal OSErr IPMNewBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1002.  THREEWORDINLINE(0x3F3C, 0x0404, 0xAA5E);
  1003.  
  1004. extern pascal OSErr IPMNewNestedMsgBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1005.  THREEWORDINLINE(0x3F3C, 0x0405, 0xAA5E);
  1006.  
  1007. extern pascal OSErr IPMNestMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1008.  THREEWORDINLINE(0x3F3C, 0x0406, 0xAA5E);
  1009.  
  1010. extern pascal OSErr IPMWriteMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1011.  THREEWORDINLINE(0x3F3C, 0x0407, 0xAA5E);
  1012.  
  1013. extern pascal OSErr IPMEndMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1014.  THREEWORDINLINE(0x3F3C, 0x0408, 0xAA5E);
  1015.  
  1016. extern pascal OSErr IPMOpenQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1017.  THREEWORDINLINE(0x3F3C, 0x0409, 0xAA5E);
  1018.  
  1019. extern pascal OSErr IPMCloseQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1020.  THREEWORDINLINE(0x3F3C, 0x040A, 0xAA5E);
  1021.  
  1022. /* Always synchronous */
  1023. extern pascal OSErr IPMVerifySignature(IPMParamBlockPtr paramBlock)
  1024.  FIVEWORDINLINE(0x7000, 0x1F00, 0x3F3C, 0x0422, 0xAA5E);
  1025.  
  1026. extern pascal OSErr IPMOpenMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1027.  THREEWORDINLINE(0x3F3C, 0x040B, 0xAA5E);
  1028.  
  1029. extern pascal OSErr IPMCloseMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1030.  THREEWORDINLINE(0x3F3C, 0x040C, 0xAA5E);
  1031.  
  1032. extern pascal OSErr IPMReadMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1033.  THREEWORDINLINE(0x3F3C, 0x040D, 0xAA5E);
  1034.  
  1035. extern pascal OSErr IPMReadHeader(IPMParamBlockPtr paramBlock, Boolean async)
  1036.  THREEWORDINLINE(0x3F3C, 0x040E, 0xAA5E);
  1037.  
  1038. extern pascal OSErr IPMOpenBlockAsMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1039.  THREEWORDINLINE(0x3F3C, 0x040F, 0xAA5E);
  1040.  
  1041. extern pascal OSErr IPMNewHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1042.  THREEWORDINLINE(0x3F3C, 0x041E, 0xAA5E);
  1043.  
  1044. extern pascal OSErr IPMReadRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1045.  THREEWORDINLINE(0x3F3C, 0x0410, 0xAA5E);
  1046.  
  1047. extern pascal OSErr IPMReadReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1048.  THREEWORDINLINE(0x3F3C, 0x0421, 0xAA5E);
  1049.  
  1050. extern pascal OSErr IPMCreateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1051.  THREEWORDINLINE(0x3F3C, 0x0411, 0xAA5E);
  1052.  
  1053. extern pascal OSErr IPMDeleteQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1054.  THREEWORDINLINE(0x3F3C, 0x0412, 0xAA5E);
  1055.  
  1056. extern pascal OSErr IPMEnumerateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1057.  THREEWORDINLINE(0x3F3C, 0x0413, 0xAA5E);
  1058.  
  1059. extern pascal OSErr IPMChangeQueueFilter(IPMParamBlockPtr paramBlock, Boolean async)
  1060.  THREEWORDINLINE(0x3F3C, 0x0414, 0xAA5E);
  1061.  
  1062. extern pascal OSErr IPMDeleteMsgRange(IPMParamBlockPtr paramBlock, Boolean async)
  1063.  THREEWORDINLINE(0x3F3C, 0x0415, 0xAA5E);
  1064.  
  1065. extern pascal OSErr IPMAddRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1066.  THREEWORDINLINE(0x3F3C, 0x0403, 0xAA5E);
  1067.  
  1068. extern pascal OSErr IPMAddReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1069.  THREEWORDINLINE(0x3F3C, 0x041D, 0xAA5E);
  1070.  
  1071. extern pascal OSErr IPMOpenHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1072.  THREEWORDINLINE(0x3F3C, 0x0417, 0xAA5E);
  1073.  
  1074. extern pascal OSErr IPMGetBlkIndex(IPMParamBlockPtr paramBlock, Boolean async)
  1075.  THREEWORDINLINE(0x3F3C, 0x0418, 0xAA5E);
  1076.  
  1077. extern pascal OSErr IPMGetMsgInfo(IPMParamBlockPtr paramBlock, Boolean async)
  1078.  THREEWORDINLINE(0x3F3C, 0x0419, 0xAA5E);
  1079.  
  1080. #endif
  1081.  
  1082. #if PRAGMA_ALIGN_SUPPORTED
  1083. #pragma options align=reset
  1084. #endif
  1085.  
  1086. #if PRAGMA_IMPORT_SUPPORTED
  1087. #pragma import off
  1088. #endif
  1089.  
  1090. #ifdef __cplusplus
  1091. }
  1092. #endif
  1093.  
  1094. #endif /* __OCEMESSAGING__ */
  1095.  
  1096.